package my.diplom.dao.impl;

import my.diplom.dao.IPriorityDAO;
import my.diplom.entity.Priority;

import java.util.List;

import org.springframework.orm.hibernate3.HibernateTemplate;

/**
 * Created by IntelliJ IDEA.
 * User: gb
 * Date: 10.11.2009
 * Time: 1:59:37
 * To change this template use File | Settings | File Templates.
 */
public class PriorityDAOImpl implements IPriorityDAO{

     private HibernateTemplate template;

    public void setTemplate(HibernateTemplate template) {
        this.template = template;
    }

    @Override
    public Priority getById(Long priorityId) {
        return (Priority) template.get(Priority.class, priorityId);
    }

    @Override
    public List<Priority> getAll() {
        //noinspection JpaQlInspection
        return template.find("from Priority order by priorityId");
    }


}
